﻿<%@ Page Culture="auto" UICulture="auto" Title="Tabbed display" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="TabbedDisplay.aspx.cs" Inherits="BM.Tools.WebControls.MForm.Example.Display.Modifiers.TabbedDisplay" %>

<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls"
    TagPrefix="mf" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.Additions"
    TagPrefix="mfadd" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.Modifiers"
    TagPrefix="mfmod" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.Tabs"
    TagPrefix="mftab" %>
<%@ Register TagPrefix="contents" TagName="ArtGallery" Src="~/Display/UserControls/ArtGalleryContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Museum" Src="~/Display/UserControls/MuseumContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Cinema" Src="~/Display/UserControls/CinemaContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Pub" Src="~/Display/UserControls/PubContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Restaurant" Src="~/Display/UserControls/RestaurantContent.ascx" %>
<asp:Content runat="server" ContentPlaceHolderID="Demonstration">
    <p>
        Items will be displayed in two separate tab containers:
        <ul>
            <li>art gallery and museum will be added to art tab container </li>
            <li>cinema, pub and restaurant will be added to entertainment tab container</li>
        </ul>
    </p>
    <mf:RootValidator runat="server" ControlToValidate="Root1" />
    <mf:Root ID="Root1" runat="server">
        <UriMappings>
            <mf:UriMapping Prefix="xs" Namespace="http://www.w3.org/2001/XMLSchema"></mf:UriMapping>
            <mf:UriMapping Prefix="" Namespace=""></mf:UriMapping>
        </UriMappings>
        <Contents>
            <mf:Branch Name="CityActivities" runat="server">
                <Contents>
                    <div>
                        Art tab container
                    </div>
                    <mftab:TabContainer runat="server" ID="ArtTabContainer" />
                    <mf:Branch Name="ArtGallery" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:ArtGallery runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:TabbedDisplayModifier TabContainerId="ArtTabContainer" />
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Museum" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Museum runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:TabbedDisplayModifier TabContainerId="ArtTabContainer" />
                        </Modifiers>
                    </mf:Branch>
                    <div>
                        Entertainment tab container
                    </div>
                    <mftab:TabContainer runat="server" ID="EntertainmentTabContainer" />
                    <mf:Branch Name="Cinema" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Cinema runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:TabbedDisplayModifier TabContainerId="EntertainmentTabContainer" />
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Pub" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Pub runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:TabbedDisplayModifier TabContainerId="EntertainmentTabContainer" />
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Restaurant" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Restaurant runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:TabbedDisplayModifier TabContainerId="EntertainmentTabContainer" />
                        </Modifiers>
                    </mf:Branch>
                </Contents>
            </mf:Branch>
        </Contents>
    </mf:Root>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Description" runat="server">
    <p>
        In the example above the tab display functionality is presented. The tabs display
        can be added using the <code>TabbedDisplayModifier</code> modifier.
    </p>
    <p>
        The tab container to which the items should be attached has to be set using the <code>TabContainerId</code>.
        The tab container with the given id should exist within the parent offspring of the offsprings on which the modifier is set.
        
    </p>    
    <div class="Remark">
        <p>
            It is important that all items of the same <code>TabContainerId</code> should follow
            one another and should not be intertwined with different content. Otherwise the
            result may be awkard, as the shown item will not be under the tab container.</p>
    </div>
</asp:Content>
